package com.yuantu.judiciary.dao;

import com.yuantu.judiciary.model.domain.QueryEntityDO;
import com.yuantu.judiciary.model.enums.SearchType;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * 查询实体数据库操作接口
 *
 * @author syw
 * @since 2023-07-25
 **/
public interface IQueryEntityDao extends JpaRepository<QueryEntityDO, Long> {

    QueryEntityDO findByIdAndDeletedFalse(Long id);

    List<QueryEntityDO> findByIdInAndDeletedFalse(List<Long> ids);

    QueryEntityDO findByNameAndCodeAndTypeAndCreatorIdAndDeletedFalse(String name, String code, SearchType type, Long userId);

    QueryEntityDO findByNameAndTypeAndDeletedFalse(String name, SearchType type);

    List<QueryEntityDO> findByTypeAndDeletedFalse(SearchType type);

}
